/*
 * PPD.h
 *
 *  Created on: 11/10/2011
 *      Author: utn_so
 */

#ifndef PPD_H_
#define PPD_H_

typedef struct{
	char a[512];
}sectType;

typedef struct{
	int cilinder;
	int head;
	int sector;
}CHS;

typedef struct{
	long maxSector;
	sectType *buffer;
	long *sectorList;
	sectType *pArchivo;
}searchType;

long getSector(CHS dir,int cilinders,int heads,int sectors);

CHS getRealDir(long sector,int cilinders,int heads,int sectors);

int GetBitValue(int n, int bitPosition);

unsigned int valorEnBits(int n);

sectType bringSector(int fileDescriptor ,long sector);

void writeSector(int fileDescriptor ,long sector, sectType datos);

int openFile(char *path);

sectType* mapFile(int fileDescriptor, long fileSize, int mode);

long getSector(CHS dir,int cilinder,int head,int sector);

CHS getRealDir(long sector,int cilinders,int heads,int sectors);

void createSearchThread(void *thread);



#endif /* PPD_H_ */
